package cn.edu.hunau.thread;

import java.time.LocalTime;
import java.time.temporal.TemporalUnit;

/**
 * @author hb
 * @date 2025-08-18 10:18:11
 */
public class TestSleep {
    public static void main(String[] args) {
        Thread t1=new Thread("t-01"){
            @Override
            public void run() {
                for (int i = 0; i < 50; i++){
                    System.out.println("\t"+getName()+"正在运行 i="+i+" time="+ LocalTime.now());
                    if (i%3==0){
                        try {
                            Thread.sleep(2000);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        };
        t1.start();
    }
}
